<%@ Page Title="" Language="C#" MasterPageFile="~/Themes/Default/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="MvcContrib.UI.Html" %>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">	
<%=Html.jQueryValidateScriptInclude() %>
<%=Html.Stylesheet("~/Content/checkbox/jquery.ryanfait-checkbox-red.css")%>
<%=Html.Stylesheet("~/Content/checkbox/jquery.ryanfait-radiobox-red.css")%>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%=Html.Resource("User", "TITLE_CREATEUSER")%>
	</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="PostScript" runat="server">
    <script type="text/javascript" language="javascript">
        $(document).ready(function() {
            $("#form1").validate({
                rules: {
                    userName: {
                        required: true,
                        minlength: 5,
                        maxlength: 20
                    },
                    email: {
                        required: true,
                        email: true
                    },
                    password1: {
                        required: true,
                        minlength: 6,
                        maxlength: 15
                    },
                    password2: {
                        required: true,
                        minlength: 6,
                        maxlength: 15,
                        equalTo: "#password1"
                    },
                    roles:
                    {
                        required:true,
                    }
                },
                messages:
                {
                    password2:
                    {
                        equalTo: "The two passwords should be same"
                    }
                }
            });
            $("input[name='btnClear']").click(function() { clearFormFields("#form1"); });
        });
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<form id="form1" action="/User/Create" method="post">
    <h2><%=Html.Resource("User", "TITLE_CREATEUSER")%></h2>
    <div class="tabcontainer">
    
    <input type="submit" value="<% =Html.Resource("Global","SAVE") %>" name="btnSave" class="button" accesskey="S" title="Save[Alt+S]"/>
    <input type="button" value="<% =Html.Resource("Global","CLEAR") %>" name="btnClear" class="button"/>
    <input type="button" value="<% =Html.Resource("Global","CANCEL") %>" name="btnCancel" class="button" accesskey="X" title="Cancel[Alt+X]" onclick="redirectToAction('User','Index')"/>
    <div class="error"><%=ViewData["ErrorMessage"] %></div>
    </div>
    <% =Html.RenderForm(ViewData.Model) %>
    <div class="tabcontainer">
    <input type="submit" value="<% =Html.Resource("Global","SAVE") %>" name="btnSave" class="button" accesskey="S" title="Save[Alt+S]"/>
    <input type="button" value="<% =Html.Resource("Global","CLEAR") %>" name="btnClear" class="button"/>
    <input type="button" value="<% =Html.Resource("Global","CANCEL") %>" name="btnCancel" class="button" accesskey="X" title="Cancel[Alt+X]" onclick="redirectToAction('User','Index')"/>
    </div>
</form>
</asp:Content>
